﻿@using CodeBuilderForVS2022.Entity
@inherits RazorEngine.Templating.TemplateBase<DALFileModel>
using System.Collections.Generic;
using System.Threading.Tasks;
using @(Model.Namespace).Entity.Base;
using @(Model.Namespace).Entity.Input.@(Model.Name);
using @(Model.Namespace).Entity.Output.@(Model.Name);

namespace @(Model.Namespace).IDAL
{
    /// <summary>
    /// @(Model.CnName)数据访问层接口
    ///</summary>
    public interface I@(Model.Name)DAL
    {
        /// <summary>
        /// 获取@(Model.CnName)分页列表
        ///</summary>
        Task<PageResult<Get@(Model.Name)PageOutput>> Get@(Model.Name)PageResultAsync(Get@(Model.Name)PageInput input);

        /// <summary>
        /// 获取@(Model.CnName)分页列表
        ///</summary>
        Task<List<Get@(Model.Name)PageOutput>> Get@(Model.Name)PageListAsync(Get@(Model.Name)PageInput input);

        /// <summary>
        /// 获取@(Model.CnName)
        /// </summary>
        @if (Model.ClassPropertys.FirstOrDefault(x=>x.Name=="Id"&&x.PropertyType== "string")!=null)
        {<text>
        Task<Get@(Model.Name)Output> Get@(Model.Name)OutputAsync(BaseGuidEntity input);</text>}
        else{<text>
        Task<Get@(Model.Name)Output> Get@(Model.Name)OutputAsync(BaseKeyEntity input);</text>}

        /// <summary>
        /// 获取全部@(Model.CnName)
        /// </summary>
        Task<List<Get@(Model.Name)Output>> GetAll@(Model.Name)ListAsync();

        /// <summary>
        /// 修改@(Model.CnName)
        /// </summary>
        Task Update@(Model.Name)Async(Update@(Model.Name)Input input);

        /// <summary>
        /// 新增@(Model.CnName)
        /// </summary>
        Task Add@(Model.Name)Async(Add@(Model.Name)Input input);

        /// <summary>
        /// 删除@(Model.CnName)
        /// </summary>
        @if (Model.ClassPropertys.FirstOrDefault(x => x.Name == "Id" && x.PropertyType == "string") != null)
        {<text>
        Task Delete@(Model.Name)Async(BaseGuidListInput input);</text>}
            else
            { <text>
        Task Delete@(Model.Name)Async(BaseIdListInput input);</text>}
    }
}
